// rem  样式适配
(function(doc, win) {
    var _root = doc.documentElement,
        resizeEvent = 'orientationchange' in window ? 'orientationchange' : 'resize',
        resizeCallback = function() {
            var clientWidth = _root.clientWidth,
                fontSize = 10;
            if (!clientWidth) return;
            if (clientWidth < 640 && clientWidth != 384) {
                fontSize = parseInt(10 * (clientWidth / 320));
            } else if (clientWidth == 384) {
                fontSize = 11;
            } else {
                fontSize = parseInt(10 * (640 / 320));
            }
            _root.style.fontSize = fontSize + 'px';
            doc.getElementsByTagName("body")[0].style.display = "block";
        };

    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvent, resizeCallback, false);
    doc.addEventListener('DOMContentLoaded', resizeCallback, false);
})(document, window);
